# -*- encoding: utf-8 -*-

class AddSubDeviceFailedReason:
    def __init__(self):
        self._node_id: str = ""
        self._product_id: str = ""
        self._error_code: str = ""
        self._error_msg: str = ""

    @property
    def node_id(self):
        return self._node_id

    @node_id.setter
    def node_id(self, value):
        self._node_id = value

    @property
    def product_id(self):
        return self._product_id

    @product_id.setter
    def product_id(self, value):
        self._product_id = value

    @property
    def error_code(self):
        return self._error_code

    @error_code.setter
    def error_code(self, value):
        self._error_code = value

    @property
    def error_msg(self):
        return self._error_msg

    @error_msg.setter
    def error_msg(self, value):
        self._error_msg = value

    def to_dict(self):
        return {"node_id": self._node_id,
                "product_id": self._product_id,
                "error_code": self._error_code,
                "error_msg": self._error_msg}

    def convert_from_dict(self, json_dict: dict):
        json_name = ["node_id", "product_id", "error_code", "error_msg"]
        for key in json_dict.keys():
            if key not in json_name:
                continue
            if key == "node_id":
                self.node_id = json_dict.get(key)
            elif key == "product_id":
                self.product_id = json_dict.get(key)
            elif key == "error_code":
                self.error_code = json_dict.get(key)
            elif key == "error_msg":
                self.error_msg = json_dict.get(key)
            else:
                pass














